package com.yumaolin.deepunderstand.leetcode.algorithm.simple;

import java.util.*;
import java.io.*;

public class Main {

    public static String StringChallenge(String str) {
        // code goes here
        List<Character> list = new ArrayList<>();
        char[] charStr = str.toCharArray();
        int length = charStr.length;
        int last_p = 0;
        for(int i=0;i<length/2;i++){
            if(charStr[i] == charStr[length-1-last_p]){
                last_p++;
                continue;
            }else{
                list.add(charStr[i]);
                if(i == (length/2)-1){
                    for(int j = length/2;j<length;j++){
                        list.add(charStr[j]);
                    }
                }
            }
        }
        if(list.isEmpty()){
            return str;
        }
        if(list.size() > 2){
            return "not possible";
        }
        StringBuilder returnStr = new StringBuilder();
        for(Character character : list){
            returnStr.append(character);
        }
        return returnStr.toString();
    }

    public static void main (String[] args) {
        // keep this function call here
        Scanner s = new Scanner(System.in);
        System.out.print(StringChallenge(s.nextLine()));
    }

}